package com.hmkj.trade_push;

import com.hmkj.core.api.ufx.call.QuotationCall;

/**
 * Test
 *
 * @author Vector
 * @create 2017-11-14 10:07
 */
public class Test {

//    public static void main(String[] args) throws Exception {
//        TransactionCall.getInstance().initT2();
//        TransactionCall.getInstance().accountLogin("MPN:18072850376;IP:127.0.0.1","Q1162942521","659047");
//    }
    public static void main(String[] args) throws Exception {
        QuotationCall.getInstance().initT2();
        QuotationCall.getInstance().reqSubQuotation();
//        TransactionCall.getInstance().accountLogin("MPN:18072850376;IP:127.0.0.1","Q1162942521","659047");
    }
//
//    public static void main(String[] args) throws ParseException {
//        SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//        System.out.println(Test.isTradeTime(f.parse("2017-11-15 19:14:59")));
//        System.out.println(Test.isTradeTime(f.parse("2017-11-15 09:15:01")));
//        System.out.println(Test.isTradeTime(f.parse("2017-11-15 11:59:59")));
//        System.out.println(Test.isTradeTime(f.parse("2017-11-15 12:00:01")));
//        System.out.println(Test.isTradeTime(f.parse("2017-11-15 13:00:01")));
//        System.out.println(Test.isTradeTime(f.parse("2017-11-15 16:24:59")));
//        System.out.println(Test.isTradeTime(f.parse("2017-11-15 16:25:01")));
//
//        System.out.println(Test.isTradeTime(f.parse("2017-11-15 17:14:59")));
//        System.out.println(Test.isTradeTime(f.parse("2017-11-15 17:15:01")));
//        System.out.println(Test.isTradeTime(f.parse("2017-11-15 23:39:59")));
//        System.out.println(Test.isTradeTime(f.parse("2017-11-15 23:40:01")));
//        System.out.println(Test.isTradeTime(f.parse("2017-11-15 00:00:00")));
//
//    }
//
//    public static boolean isTradeTime(Date now) throws ParseException {
//        SimpleDateFormat f1 = new SimpleDateFormat("yyyy-MM-dd");
//        SimpleDateFormat f2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//        String value = "14:00,24:00|00:00,03:55";
//        String[] args = value.split(";");
//        for (String arg : args) {
//            String[] times = arg.split("\\|");
//            for (String time : times) {
//                String[] items = time.split(",");
//                Date start = f2.parse(f1.format(now) + " " + items[0] + ":00");
//                Date end = f2.parse(f1.format(now) + " " + items[1] + ":00");
//                if (now.after(start) && now.before(end)) {
//                    return true;
//                }
//            }
//        }
//        return false;
//    }
}
